﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Fuse8.ContentManagementFramework.Administration.Attributes;

namespace Fuse8.ContentManagementFramework.Administration.Models
{
    public class CmsEntityMetaFieldLinkModel
    {
        public int EntityMetaFieldId { get; set; }
        public int Id { get; set; }

        public string EntityTypeParameter { get; set; }

        public string DisplayLabel { get; set; }

        public bool IsAllowMultipleValues { get; set; }        

        public bool IsRequired { get; set; }

        public int MetaFieldOrder { get; set; }

        public bool IsSystem { get; set; }

        [GlobalizedRequired("Please enter internal name", "cms_Metas")]
        public string MetaFieldName { get; set; }

        public string MetaFieldDescription { get; set; }

        [GlobalizedRequired("Please enter type", "cms_Metas")]
        public string MetaFieldType { get; set; }

        public string EditorName { get; set; }

        public string DefaultValue { get; set; }

        public bool PredefinedListOfValues { get; set; }

        public List<CmsKeyValueItem> Values { get; set; }

        public IEnumerable<string> ValuesProviders { get; set; }

        public string MetaValuesProviderName { get; set; }

        public bool AddPleaseSelect { get; set; }

        public string ValuesControl { get; set; }
    }

    [Serializable]
    public class CmsKeyValueItem
    {
        public string Key { get; set; }
        public string Value { get; set; }
        public bool Selected { get; set; }
    }
}